{% extends "base.html" %}
{% import "bootstrap/wtf.html" as wtf %}
{% import "_macros.html" as macros %}

{% block title %}BBblog{% endblock %}

{% block page_content %}
{% if current_user.is_administrator() %}
<div class="list-group">
    <a href="{{ url_for('main.new_posttype') }}" class="list-group-item">
        <h4 class="list-group-item-heading">新建归档</h4>
        <p class="list-group-item-text">新建博客的归档......</p>
    </a>
</div>
{% endif %}
{% for type in types %}
<div class="list-group">
    <a href="{{ url_for('.posttype',id=type.id) }}" class="list-group-item">
        <h4 class="list-group-item-heading">{{ type.name }}</h4>
        <p class="list-group-item-text">{{ type.explain }}</p>
    </a>
    {% if current_user.is_administrator() %}
    <div class="list-group-item">
        <a style="margin-right:10px" onclick="return confirm('确定要删除吗？')"
            href="{{ url_for('.delete_posttype',id=type.id) }}"><span class="glyphicon glyphicon-trash"></span>
            删除
        </a>
        <a href="{{ url_for('.update_posttype',id=type.id) }}"><span class="glyphicon glyphicon-edit"></span>
            修改
        </a>
    </div>
    {% endif %}
</div>
{% endfor %}
{% endblock %}